package com.luo.controller;

import com.luo.pojo.Results;
import com.luo.pojo.User;
import com.luo.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class loginController {
    private final UserService userService;

    @Autowired
    private loginController(UserService userService) {
        this.userService = userService;
    }


    @PostMapping("/login")
    public Results login(@RequestBody User user) {
        log.info("用户登录登录手机号{}", user.getPhone());
        return userService.login(user);
    }

}
